//
//  UIButton+Extension.m
//  OC版新浪微博
//
//  Created by chenguanglei on 16/12/3.
//  Copyright © 2016年 itheima. All rights reserved.
//

#import "UIButton+Extension.h"

@implementation UIButton (Extension)

+ (instancetype)buttonTitle:(NSString *)title titleColor:(UIColor *)color titleSize:(CGFloat)font normalImage:(NSString *)imageName bgImage:(NSString *)bgImage corner:(CGFloat)corner{

    UIButton *btn = [[UIButton alloc]init];
    
    [btn setTitle:title forState:UIControlStateNormal];
    
    [btn setTitleColor:color forState:UIControlStateNormal];
    
    btn.titleLabel.font = [UIFont systemFontOfSize:font];
    
    [btn setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
    
    [btn setBackgroundImage:[UIImage imageNamed:bgImage] forState:UIControlStateNormal];
    
    btn.layer.cornerRadius = corner;
    

    return btn;
}

@end
